First of all, passing arguments to an app is very unusual.
It is but not totally out of the ordinary. I'm porting that side of things to a dedicated cli tool but I'm also learning about xpc, notifications etc at the same time. I would like to be more "mac arsed" in my app development. Insert comment about tech debt here. That said, --args is a feature available in the open command and CommandLine.arguments is a property available to macOS apps. The expectation is that those should operate consistently. I'm also aware that there is a potential conflict with things like using -AppleLanguages to change the language an app is launched in so there is some pre-processing going on by the OS that is parsed before an app is launched fully but again, --args is available to be used, whatever macOS is doing should be able to handle that and just pass through arguments array into the app.
Plus, you are running all this through the "open" tool. Does it behave the same if you directly launch the executable with your arguments?
Exact same behaviour. using open or calling the executable directly with arguments has the exact same effect.
I did some further testing though. I created a new macOS 15 VM, installed Xcode 16 and nothing else. Creating a new project and compiling the boilerplate SwiftUI app adding nothing else and I can re-create the behaviour:
# three single arguments
open ./demoapp.app --args --foo --bar --baz
./demoapp.app/Contents/MacOS/demoapp --foo --bar --baz
# App window displays as expected
# one single argument, one arg value pair
open ./demoapp.app --args --foo --bar baz
./demoapp.app/Contents/MacOS/demoapp --foo --bar baz
# The app window will not appear.
and the same with the rest of the examples. TBC, in the second example, the app launches, but the main window does not appear until I click on the icon for it in the dock. Adding NSApp.activate(ignoringOtherApps: true) has no effect as if the app window doesn't exist.
edit: just adding in that I'm using a SwiftUI app in my demo but the same behaviour appears if using AppKit lifecycle. My gut tells me it's something with how macOS 15 is pre-processing arguments, looking for whatever, and how Xcode 16 compiles those apps. apps compiled in Xcode 15 (macos 14) don't have any of these issues, but I don't know enough about the app lifecycle on macOS to dig deeper and understand what's going on. Ultimately the fix is I re-write how I accept/process arguments but I'm not quite there yet, hence I have a dev box stuck on macOS 14 for the time being.